package org.idea.spring.dependency.inject.source;

import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.AnnotationConfigUtils;
import org.springframework.context.annotation.CommonAnnotationBeanPostProcessor;
import org.springframework.context.annotation.ConfigurationClassPostProcessor;
import org.springframework.context.event.EventListenerMethodProcessor;

import javax.annotation.PreDestroy;

/**
 * @Author linhao
 * @Date created in 5:18 下午 2021/4/29
 */
public class BeanSource {

    public static void main(String[] args) {
        /**
         * 处理Spring配置对象
         */
        ConfigurationClassPostProcessor configurationClassPostProcessor;

        /**
         * 处理Spring中Bean的一些@Autowired @Value 字段值注入
         */
        AutowiredAnnotationBeanPostProcessor autowiredAnnotationBeanPostProcessor;

        /**
         * 处理一些通用注解，例如说@PostContruct @PreDestroy JSR-250注解 等
         */
        CommonAnnotationBeanPostProcessor commonAnnotationBeanPostProcessor;

        /**
         * 处理标注@EventListener的Spring容器事件监听方法
         */
        EventListenerMethodProcessor eventListenerMethodProcessor;

        AnnotationConfigApplicationContext annotationConfigApplicationContext;
        //spring内部注册自用bean
        AnnotationConfigUtils.registerAnnotationConfigProcessors(null);
    }
}
